package com.lej.player

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent

import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer

/**
 * 无ui播放界面
 */
class PlayerView : StandardGSYVideoPlayer {
    constructor(context: Context, fullFlag: Boolean?) : super(context, fullFlag!!)

    constructor(context: Context) : super(context)

    constructor(context: Context, attrs: AttributeSet) : super(context, attrs)

    override fun touchDoubleUp(e: MotionEvent?) {//重写双击方法

    }

    override fun getLayoutId() = R.layout.empty_control_video

    override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) {
        super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY)
        //不给触摸快进，如果需要，屏蔽下方代码即可
        mChangePosition = false

        //不给触摸音量，如果需要，屏蔽下方代码即可
        mChangeVolume = false

        //不给触摸亮度，如果需要，屏蔽下方代码即可
        mBrightness = false
    }

    override fun onAttachedToWindow() {
        super.onAttachedToWindow()
        onVideoResume(false)
    }

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        onVideoPause()
    }
}
